$(document).ready(function() {
	var list = [{//1
			name: "财务总监",
			num: 1,
			company: "时兴装饰",
			time: "2017-12-8",
			lurl: "http://www.baidu.com"
		},
		{//2
			name: "运营总监",
			num: 1,
			company: "时兴装饰",
			time: "2017-12-8",
			lurl: "#"
		},
		{//3
			name: "人力资源经理",
			num: 1,
			company: "时兴装饰",
			time: "2017-12-8",
			lurl: "#"
		},
		{//4
			name: "生产总监",
			num: 1,
			company: "时兴装饰",
			time: "2017-12-8",
			lurl: "#"
		},
		{//5
			name: "造价工程师",
			num: 1,
			company: "雅玥园林",
			time: "2017-12-8",
			lurl: "#"
		},
		{//6
			name: "项目总监",
			num: 1,
			company: "雅玥园林",
			time: "2017-12-8",
			lurl: "#"
		},
		{//7
			name: "高级商务经理(广州)",
			num: 1,
			company: "振中建设",
			time: "2017-12-8",
			lurl: "#"
		},
		{//8
			name: "PC材料事业部筹建高级/经理",
			num: 1,
			company: "雅丰贸易",
			time: "2017-12-8",
			lurl: "#"
		},
		{//9
			name: "主任/高级室内设计师",
			num: 1,
			company: "原构设计",
			time: "2017-12-8",
			lurl: "#"
		},
		{//10
			name: "主任/景观设计师",
			num: 1,
			company: "原构设计",
			time: "2017-12-8",
			lurl: "#"
		},
		{//11
			name: "工程中心高级机电经理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//12
			name: "工程中心高级土建经理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//13
			name: "人力行政中心总裁助理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//14
			name: "成本中心高级合约工程师",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//15
			name: "高级运营经理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//16
			name: "高级投后管理经理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//17
			name: "投资运营中心投资经理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//18
			name: "投资运营中心审计经理 ",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		},
		{//19
			name: "财务中心高级成本经理",
			num: 1,
			company: "集团本部",
			time: "2017-12-8",
			lurl: "#"
		}
	];
	var s;
	for(var i = 0; i < 19; i++) {
		s = "<tr><td>" +
			list[i].name + "</td><td>" +
			list[i].num + "</td><td>" +
			list[i].company + "</td><td>" +
			list[i].time + "</td><td>" +
			"<a href=" + list[i].lurl + ">查看</a></td></tr>";
		$("#tab").append(s);
	}

});

function divshow() {
	var sel1 = document.getElementById('sel1');
	var val1 = sel1.options[sel1.selectedIndex].value;

	var sel2 = document.getElementById('sel2');
	var val2 = sel2.options[sel2.selectedIndex].value;

	switch(val1) {
		case '0':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "";
			}
			sel();
			break;
		case '1':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "none";
			}
			document.getElementById('div0').style.display = "";
			s[13].style.display = "";
			s[7].style.display = "";
			s[3].style.display = "";
			break;
		case '2':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "none";
			}
			document.getElementById('div0').style.display = "";
			s[12].style.display = "";
			s[11].style.display = "";
			s[10].style.display = "";
			s[9].style.display = "";
			s[8].style.display = "";
			s[6].style.display = "";
			s[5].style.display = "";
			s[4].style.display = "";
			break;
		case '3':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "none";
			}
			document.getElementById('div0').style.display = "";
			s[1].style.display = "";
			s[19].style.display = "";
			break;
		case '4':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "none";
			}
			document.getElementById('div0').style.display = "";
			s[18].style.display = "";
			s[17].style.display = "";
			s[16].style.display = "";
			s[15].style.display = "";
			s[2].style.display = "";
			
			break;
		case '5':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "none";
			}
			document.getElementById('div0').style.display = "";
			s[14].style.display = "";
			break;
		default:
			break;
	}
}
//====第二个select=====================================================================================
function sel(){
	var val2 = sel2.options[sel2.selectedIndex].value;

	switch(val2) {
		case '1':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				s[i].style.display = "none";
			}
			document.getElementById('div0').style.display = "";
			break;
		case '2':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				if(s[i]["cells"][2].innerHTML == "集团本部") {
					s[i].style.display = "";
				} else {
					s[i].style.display = "none";
				}
			}
			document.getElementById('div0').style.display = "";
			break;
		case '3':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				if(s[i]["cells"][2].innerHTML == "原构设计") {
					s[i].style.display = "";
				} else {
					s[i].style.display = "none";
				}
			}
			document.getElementById('div0').style.display = "";
			break;
		case '4':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				if(s[i]["cells"][2].innerHTML == "雅丰贸易") {
					s[i].style.display = "";
				} else {
					s[i].style.display = "none";
				}
			}
			document.getElementById('div0').style.display = "";
			break;
		case '5':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				if(s[i]["cells"][2].innerHTML == "振中建设") {
					s[i].style.display = "";
				} else {
					s[i].style.display = "none";
				}
			}
			document.getElementById('div0').style.display = "";
			break;
		case '6':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				if(s[i]["cells"][2].innerHTML == "雅玥园林") {
					s[i].style.display = "";
				} else {
					s[i].style.display = "none";
				}
			}
			document.getElementById('div0').style.display = "";
			break;
		case '7':
			var s = document.getElementsByTagName("tr");
			for(i = 0; i < s.length; i++) {
				if(s[i]["cells"][2].innerHTML == "时兴装饰") {
					s[i].style.display = "";
				} else {
					s[i].style.display = "none";
				}
			}
			document.getElementById('div0').style.display = "";
			break;
		default:
			break;
	}
}